import { defineStore } from "pinia";
import { ref } from "vue";

export const useSettingStore = defineStore("settingStore", () => {
  /** 属于功能模块--是否要移出setting */
  /** 是否刷新 */
  const refresh = ref(false);

  /** 属于界面显示 */
  /** 是否显示刷新按钮 */
  const showRefreshButton = ref(true);

  /**
   * 切换刷新按钮显示
   */
  const setShowRefreshButton = () => {
    showRefreshButton.value = !showRefreshButton.value;
  };

  /**
   * 刷新页面
   */
  const reload = () => {
    refresh.value = !refresh.value;
  };

  return {
    refresh,
    showRefreshButton,
    setShowRefreshButton,
    reload,
  };
});
